-- GENERATED SPELL FOR [Blackwing Warlock] --


function spell0_12459(pUnit, Event) --@Demon Portal,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(22372,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_12459', 1, 1)
end

function spell1_12459(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(22336,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12459', 2000, 1)
end

function Sorts_12459(pUnit, Event)
local choix_sorts_12459 = math.random(0, 1)
if choix_sorts_12459 == 0 then
pUnit:RegisterEvent('spell0_12459', 1, 1)
end
if choix_sorts_12459 == 1 then
pUnit:RegisterEvent('spell1_12459', 1, 1)
end
end

function mob12459_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12459', math.random(1500, 3000), 1)
end

function mob12459_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12459_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12459_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12459, 1, 'mob12459_Action')
RegisterUnitEvent(12459, 2, 'mob12459_Leave')
RegisterUnitEvent(12459, 3, 'mob12459_Kill')
RegisterUnitEvent(12459, 4, 'mob12459_Die')
